package com.kaiwukj.android.ufamily.mvp.ui.page.home.home.contract

import com.kaiwukj.android.mcas.mvp.IModel
import com.kaiwukj.android.mcas.mvp.IView
import com.kaiwukj.android.ufamily.mvp.http.entity.base.ListResp
import com.kaiwukj.android.ufamily.mvp.http.entity.params.ActiveParams
import com.kaiwukj.android.ufamily.mvp.http.entity.params.CommentParams
import com.kaiwukj.android.ufamily.mvp.http.entity.params.DynamicListParams
import com.kaiwukj.android.ufamily.mvp.http.entity.result.*
import com.kaiwukj.android.ufamily.mvp.ui.page.home.home.HomeData01Zip
import io.reactivex.Observable

interface HomeV20Contract {
    interface View : IView {
        fun onFetchDynamic(list: MutableList<DynamicResult>)
        fun onFetchData(result: HomeData01Zip)
        fun onCommentResult(commentId: Int, params: CommentParams)

        fun onFetchFriend(results: MutableList<FriendRecoResult>)

    }

    interface ActiveView : IView {
        fun onFetchActive(results: List<ActiveResult>)
        fun onFetchActiveDetail(result: ActiveResult)
    }

    interface Model : IModel {

        fun fetchNotice(): Observable<ListResp<CommunityNoticeResult>>

        fun fetchDynamic(params: DynamicListParams): Observable<ListResp<DynamicResult>>

        fun getCommunityInfo(communityId: Int): Observable<CommunityInfoResult>

        fun fetchCommunityNews(communityId: Int): Observable<ListResp<CommunityNewResult>>

        /**
         * 获取我关注的动态
         * @param type 1：院子里 2：同城 默认是1
         */
        fun fetchAttentionDynamic(startId: Int, pageSize: Int, type: Int): Observable<ListResp<DynamicResult>>

        fun fetchActive(params: ActiveParams): Observable<ListResp<ActiveResult>>

        fun fetchHotActive(type: Int): Observable<List<ActiveResult>>

        fun fetchMyActive(page: Int, pageSize: Int): Observable<ListResp<ActiveResult>>

        fun getActiveDetail(id: Int): Observable<ActiveResult>

        fun join(id: Int): Observable<Int>

        fun unJoin(id: Int): Observable<Int>

        /**
         * @param type 1：院子里 2：同城 默认是1
         */
        fun fetchRecoAttention(type: Int): Observable<MutableList<FriendRecoResult>>

        /**
         * 点赞
         *
         * @param id 动态Id
         * @return code
         */
        fun postLike(id: Int): Observable<Int>

        /**
         * 取消点赞
         *
         * @param id 动态Id
         * @return code
         */
        fun postNoLike(id: Int): Observable<Int>

        /**
         * 关注
         *
         * @param id 用户Id
         * @return code
         */
        fun attention(id: Int): Observable<Int>

        fun comment(params: CommentParams): Observable<Int>

        /**
         * 屏蔽
         *
         * @param uId   userId
         * @param block statusFlag
         * @param user  是用户
         * @return code
         */
        fun shield(uId: Int, block: Boolean, user: Boolean): Observable<Int>

        //删除自己发布的动态
        fun delDynamic(dynamicId: Int): Observable<Int>


    }
}